@extends('admin/layout')
@section('title','友情链接管理')
@section('content')
<!-- Content Header (Page header) -->
<section class="content-header">
  <h1>
    友情链接列表
    <small>友情链接列表</small>
  </h1>
  <ol class="breadcrumb">
  	<li><a href="#"><i class="fa fa-th"></i> 友情链接首页</a></li>
    <li><i class="fa fa-users"></i> 友情链接管理</li>
    <li><a href="#"><i class="fa fa-user"></i> 友情链接列表</a></li>
    <li class="active">友情链接列表</li>
  </ol>
</section>

<!-- Main content -->
<section class="content">
  <div class="row">
    <div class="col-md-12">
      <!-- box start -->
      <div class="box box-info">
      @if(session('success'))
        <div class="alert alert-danger">
            {{session('success')}}
        </div>
      @endif
      @if(session('error'))
        <div class="alert alert-danger">
            {{session('error')}}
        </div>
      @endif
      <div class="box-header with-border">
        <h3 class="box-title"><i class="fa fa-user">友情链接列表</i></h3>
      </div>
      <div class="box-body">
        <div class="row">
          <div class="col-md-3">
            <button onclick="window.location.href='{{asset('admin/frilink/add')}}'" class="btn bg-orange">添加友情链接</button>
          </div>
        </div>
        <div class="row">
          &nbsp;
        </div>
        
        <div class="row">
          &nbsp;
        </div>
        <div class="table-responsive">
        <table id="member_list" class="table table-bordered table-striped text-center">
          <thead>
          <tr>
            <th>ID</th>
            <th>友情链接标题</th>
            <th>友情链接描述</th>
            <th>友情链接地址</th> 
            <th>友情链接图片</th> 
            <th>状态</th>
            <th>操作</th> 

          </tr>
          </thead>
          <tbody>
          @foreach($data as $key => $val)
          <tr>
            <td>{{$val->fri_link_id}}</td>
            <td>{{$val->title}}</td>
            <td>{{$val->description}}</td>
            <td>{{$val->url}}</td>
            <td>
              <img style="width:100px;" src="/uploads/website/frilink/{{$val->pic}}">
            </td>
            <td><div style="height:60px"> @if($val->disabled == 1)
              启用
              @else
              禁用
              @endif</div>
              
            </td>
            <td><a href="/admin/frilink/{{$val->fri_link_id}}/edit">编辑</a>&nbsp;|&nbsp;<a class="status" href="/admin/frilink/{{$val->fri_link_id}}/status">更改状态</a>&nbsp;|&nbsp;<a href="/admin/frilink/{{$val->fri_link_id}}/delete">删除</a></td>
          </tr> 
          @endforeach
          </tbody>
          <tfoot>
          <tr>
            <th colspan="5"></th>
            <th colspan="3">
              
            </th>
          </tr>
          </tfoot>
        </table>
        </div>
        </div>
        {!! $data -> render() !!}
        <p>&nbsp;</p> 
      <!-- /.box-body -->
      <!-- /.box -->        
    </div>
  </div>
  </div>
  <script type="text/javascript">
      $('.status').on('click',function(){
        alert('状态更新成功');
      });
  </script>
</section>
<!-- /.content -->
@stop